﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DomeLou.aspx.cs" Inherits="PropertyAppraisal.DoemsKanCha.DomeLou" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
     <link href="../jquery-easyui-1.3.5/themes/default/easyui.css" rel="stylesheet" />
    <link type="/text/css" href="../jquery-easyui-1.3.5/themes/icon.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.3.5/demo/demo.css" rel="stylesheet" />

    <%--<script type="text/javascript" src="easyui/js/jquery-1.8.0.min.js"></script>--%>

    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery-1.7.2-min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.3.5/easyloader.js"></script>


    <script type="text/javascript" src="../easyui/jquery.params.js"></script>
</head>
<body>
    <div class="demo-info">
        <div class="demo-tip icon-tip"></div>
        <%--<div>Fill the form and submit it.</div>--%>
    </div>
    <div style="margin: 0;"></div>
    <form id="form1" runat="server">
        <div class="easyui-panel" fit="true" style="border: none;">
            <div style="margin-left: 30px;" id="ff">
                <table>
                    <tr>
                        <td>所在楼号：</td>
                        <td style="padding-left: 50px;">
                            <input class="easyui-validatebox" type="text" id="louhao" data-options="required:true" style="width: 800px;" placeholder="请输入所在楼号" />
                        </td>
                    </tr>
                    <tr>
                        <td>地图：</td>
                        <td style="padding-left: 50px;">
                            <div style="width: 800px; height: 300px; border: 1px solid blue;" id="map">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>定位坐标：</td>
                        <td style="padding-left: 50px;">
                            <input class="easyui-validatebox" type="text" id="zuobiao" style="width: 800px;" readonly="true" />
                        </td>
                    </tr>
                    <tr>
                        <td>定位地址：</td>
                        <td style="padding-left: 50px;">
                            <input class="easyui-validatebox" type="text" id="addr" style="width: 800px;" />
                        </td>
                    </tr>
                    <tr>
                        <td>房屋结构：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select1">
                                <%=housjBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>建筑类型：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select2">
                                   <%=typeBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>外立面装饰：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select3">
                                   <%=wzBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>公共部位装饰：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select4">
                                   <%=gzBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>电梯：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select5">
                                   <%=dianBD() %>
                            </select><br />
                            <input type="number" min="1" id="dnum" />
                        </td>
                    </tr>
                    <tr>
                        <td>供气：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select6">
                                   <%=gqBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>供水：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select7">
                                   <%=gsBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>供暖：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select8">
                                   <%=gnBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>门禁系统：</td>
                        <td style="padding-left: 50px;">
                            <select class="easyui-combobox" style="width: 800px;" id="select9">
                                   <%=doorBD() %>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>其他:</td>
                        <td style="padding-left: 50px;">
                            <textarea id="message" style="height: 60px; width: 800px;" placeholder="说点什么...最少输入10个字"></textarea>
                        </td>
                    </tr>
                </table>
            </div>
            <div style="text-align: center; padding: 5px">
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
            </div>
        </div>
    </form>


    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=4OFP8rc1v0r74nUe45AtjtiAv8KnVfZI"></script>
    <script>
        function submitForm()
        {
            var louhao = $("#louhao").val();
            var zuo = $("#zuobiao").val();
            var address = $("#addr").val();
            var housje = $("#select1").val();
            var jtype = $("#select2").val();
            var wshi = $("#select3").val();
            var gshi = $("#select4").val();
            var dian = $("#select5").val();
            var dnum = $("#dnum").val();

            var gqi = $("#select6").val();
            var gshui = $("#select7").val();
            var gnuam = $("#select8").val();
            var door = $("#select9").val();
            var qita = $("#message").val();

            var prenum = $.query.get("id");//项目号;
            $.ajax({
                type: "post", //要用post方式                 
                url: "DomeLou.aspx/submins",//方法所在页面和方法名
                data: "{'ProjectNumber':'" + prenum + "','Location_East':'" + louhao + "','Location_West':'" + zuo + "','Location_North':'" + address + "','Location_South':'" + housje + "','Location_Position':'" + jtype + "','Location_Traffic':'" + wshi + "','Location_Convenient':'" + gshi + "','Location_Humanity':'" + dian + "','Location_Quality':'" + dnum + "','Location_Community':'" + gqi + "','Location_Mature':'" + gshui + "','gongnuan':'" + gnuam + "','Location_Facilities':'" + door + "','Location_Degree':'" + qita + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var json = eval("(" + data.d + ")");

                    if (json == 1) {
                        $.messager.alert("提示信息", "提交成功");
                    }
                    else
                        $.messager.alert("提示信息", "提交失败");
                }
            });
        }


        $(function () {
            //创建地图实例
            var map = new BMap.Map("map");
            //创建点坐标
            var point = new BMap.Point(116.404, 39.915);
            //地图初始化
            map.centerAndZoom(point, 15);

            var marker = new BMap.Marker(point);        // 创建标注    
            map.addOverlay(marker);                     // 将标注添加到地图中

            //点击事件
            map.addEventListener("click", function (e) {
                map.removeOverlay(marker);
                //创建点坐标
                var xpoint = new BMap.Point(e.point.lng, e.point.lat);
                //地图初始化
                //map.centerAndZoom(xpoint, 15);
                // 创建标注
                marker = new BMap.Marker(xpoint);
                map.panTo(xpoint);
                // 将标注添加到地图中
                map.addOverlay(marker);
                $("#zuobiao").val(e.point.lng, e.point.lat);

                //内存释放
                // map.removeOverlay(marker);
                // marker.dispose();

            });
        })
    </script>
</body>
</html>
